package com.clps.dev.sms.util.excel;

import java.util.Date;

import com.clps.dev.sms.common.CommonData;
import com.clps.dev.sms.util.date.DateTool;


/**  
* @ClassName: TypeFarmat  
* @Description: 对象格式转换
* @since JDK 1.8 
* @author RuiShan.Yang  
* @date 2018-11-28 13:44:00  
* 
*/ 
public class TypeFormat {

	@SuppressWarnings("unchecked")
	public static <T> T typeFar(Class<T> class1, Object object) {

		try {

			if (class1.equals(Date.class)) {
				@SuppressWarnings("static-access")
				Date sDate = new DateTool().stringToDate((String) object, CommonData.YYYY_MM_DD_HH_MM_SS);
				return (T) sDate;
			}
			return (T) object;
		} catch (Exception e) {
		}
		return null;
	}

}
